#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>

int main()
{
	int a, c, b;
	scanf("%d %d", &a, &c);
	a ^= c;
	for (b = 0; a != 0; b++)
	{
		a &= (a - 1);
	}
	printf("%d", b);
	return 0;
}